#ifndef _RETURNSTATEMENT_HPP
#define _RETURNSTATEMENT_HPP

#include <string>
#include "Statement.hpp"
#include "Token.hpp"
#include "Expression.hpp"

namespace ast {

	class ReturnStatement : public Statement {

	public:
		ReturnStatement(TOKEN token) {
			_token = token;
		}

		virtual void StatementNode() override {}

		virtual string tokenLiteral() override {
			return _token._literal;
		}

		virtual string String() override {
			string out;
			out.append(_token._literal);
			out.append(" ");
			if (_returnValue != nullptr) {
				out.append(_returnValue->String());
			}
			out.append(";");
			return out;
		}

		~ReturnStatement() {
			if (_returnValue != nullptr) {
				//delete _returnValue;   
			}
		}

	public:
		TOKEN _token;
		Expression* _returnValue;
	};
}

#endif